<?php

use backend\models\MallMaterialMenu;
use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\MallMaterialMenuSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '素材分类';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="mall-material-menu-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('添加素材分类', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
//            'title',
            [
                'attribute' => 'title',
                'enableSorting' => false,
                'value' => 'title',
            ],
//            'des',
            [
                'attribute' => 'des',
                'enableSorting' => false,

            ],
            'sort',
//            'status',
            [
                'attribute' => 'status',
                'enableSorting' => false,
                'value' => 'status',
                'filter' => MallMaterialMenu::attributeValue()['status']
            ],
            'create_time:datetime',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
